package com.uwaterloo.interviewme.model;

import java.lang.reflect.Type;
import java.util.Map;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

/**
 * The Model object for Response.
 */
public class Response {
	
	/** The map type. */
	Type mapType = new TypeToken<Map<String, String>>() {}.getType();
	
	/** The result. */
	private Map<String, String> result;
	
	/** The gson. */
	private final Gson gson = new Gson();
	
	/**
	 * Instantiates a new response from a gson string
	 *
	 * @param gsonString the gson string
	 */
	public Response(String gsonString) {
		result = gson.fromJson(gsonString, mapType);
	}
	
	/**
	 * Gets the result Map.
	 *
	 * @return the result
	 */
	public Map<String, String> getResult() {
		return result;
	}
}
